package lk.mrt.cse.wihidum.storage;

/**
 * Created by IntelliJ IDEA.
 * User: Will
 * Date: Feb 14, 2010
 * Time: 12:53:35 AM
 * To change this template use File | Settings | File Templates.
 */

import javax.persistence.*;
import java.io.Serializable;

@Embeddable
public class SubscriberIdentifier implements Serializable
{


    private String clientID;
    private String filterTopic;
    private String uuid;

    public SubscriberIdentifier()
    {
    }

    public SubscriberIdentifier(String clientID, String filterTopic,String uuid)
    {
        this.clientID = clientID;
        this.filterTopic = filterTopic;
        this.uuid=uuid;
    }

    public String getUuid()
       {
           return uuid;
       }

    public void setUuid(String uuid)
       {
           this.uuid = uuid;
       }

    public String getFilterTopic()
    {
        return filterTopic;
    }

    public void setFilterTopic(String filterTopic)
    {
        this.filterTopic = filterTopic;
    }

    public String getClientID()
    {
        return clientID;
    }

    public void setClientID(String clientID)
    {
        this.clientID = clientID;
    }

    public int hashCode()
    {
        int result;
        result = clientID.hashCode();
        result = 29 * result + filterTopic.hashCode();
        result=29*result+uuid.hashCode();
        return result;
    }

    public boolean equals(Object other)
    {
        if (other == null)
        {
            return false;
        }
        if (!(other instanceof SubscriberIdentifier))
        {
            return false;
        }
        SubscriberIdentifier that = (SubscriberIdentifier) other;
        return this.clientID.equals(that.clientID) &&
                this.filterTopic.equals(that.filterTopic)&&
                this.uuid.equals(that.uuid);
    }


}
